﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Sun.Mvc.IDAL;
using System.Reflection;
using System.Configuration;

namespace Sun.Mvc.Factory
{
    public sealed class DataAccess
    {
        private readonly static string path = ConfigurationManager.AppSettings["Sun:Procedures"];
        /// <summary>
        /// Article
        /// </summary>
        /// <returns></returns>
        public static IArticle CreateArticle()
        {
            return (IArticle)Assembly.Load(path).CreateInstance(path + ".Article");
        }
        /// <summary>
        /// Users
        /// </summary>
        /// <returns></returns>
        public static IUsers CreateUsers()
        {
            return (IUsers)Assembly.Load(path).CreateInstance(path + ".Users");
        }
    }
}
